<template>
    <div>
        <h1>我是a组件</h1>
        <button @click="fn">点我，传递数据给b组件</button>
    </div>
</template>

<script>
// import eventBus from "../eventBus/index.js"
//自动找到eventBus文件夹中名字叫index的js文件
import eventBus from "../EventBus"
export default {
    data(){
        return {
            test: "测试数据 -- aaa"
        }
    },
    methods: {
        fn(){
            eventBus.$emit("sendData", this.test)
        }
    }
}
</script>

<style>

</style>